<?php
class CN_Controller extends CI_Controller {
    
	var $template;
	
    function __construct(){
        //session_start();
        parent::__construct(); 
		$this->template = new Template(); 
		$this->data["template_obj"] = $this->template; 
    }
    
	function get_view($page){
		return $this->template->template_name."/".$page;
	}
	
	function load_view($view_name){
		$this->load->view(self::get_view("structure/header"),$this->data);
		$this->load->view(self::get_view("structure/menu"),$this->data);
		$this->load->view(self::get_view("structure/top_nav"),$this->data);
		
		
		if(is_array($view_name)){
			foreach ($view_name as $view) {
				$this->load->view(self::get_view($view),$this->data);
			}
		}else{
			$this->load->view(self::get_view($view_name),$this->data);
		}
	}
}
?>